package com.rushb.rushbproduct.util;

import java.lang.reflect.Field;

/**
 * <p>
 * rush-b</n>
 * BeanUtil
 * </p>
 *
 * @author zhaolun.li
 * @since 2020/12/1 10:59
 */
public class BeanUtil {

    public static boolean isEmpty(Object o) {
        try {
            for (Field field : o.getClass().getDeclaredFields()) {
                //把私有属性公有化
                field.setAccessible(true);
                Object object = field.get(o);
                if (object != null) {
                    return false;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
}